build: Add option to enable/disable GIR generation
authorEmmanuele Bassi <ebassi@gnome.org>
Sat, 2 Sep 2017 11:00:05 +0000 (12:00 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Sat, 2 Sep 2017 11:00:57 +0000 (12:00 +0100)
And drop the unnecessary is_cross_build() check: it's entirely possible
to generate introspection data when cross-compiling.

gtk/meson.build
meson_options.txt

index 5fed5b7de6bf3345326af1818ec545d19bc82454..931d6c4e5e52b47db8767186c1a3e68cbdceb684 100644 (file)
@@ -916,7 +916,8 @@ libgtk_dep = declare_dependency(sources: [gtkversion, gtktypebuiltins_h],
                                 link_args: common_ldflags)
 
 # Introspection
-if not meson.is_cross_build()
+build_gir = get_option('enable-gir')
+if build_gir
   gir_args = [
     '--quiet',
   ]
index 518cecf535a0b1aa89cadcdf3791ae9051520c75..bcd4967e52371f07ce36a49b0528714cf23ad88f 100644 (file)
@@ -32,3 +32,5 @@ option('enable-documentation', type: 'boolean', value: 'false',
   description : 'Build API reference and tools documentation')
 option('enable-man-pages', type: 'boolean', value: 'false',
   description : 'Build man pages for installed tools')
+option('enable-gir', type: 'boolean', value: 'true',
+  description : 'Build introspection data (requires gobject-introspection)')